package plenprojects.guiclient.panels;

import plenprojects.guiclient.frames.MainFrame;

public class LogInPanel extends javax.swing.JPanel {
    
    private final MainFrame mainFrame;
    private final String id;
    
    public LogInPanel(MainFrame mainFrame, String id) {
        
        this.id = id;
        this.mainFrame = mainFrame;
        this.initComponents();
    }
    
    public String getId() {
        
        return id;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        UsernameInput = new javax.swing.JTextField();
        WelcomeLabel = new javax.swing.JLabel();
        PasswordInput = new javax.swing.JPasswordField();
        PasswordLabel = new javax.swing.JLabel();
        UsernameLabel = new javax.swing.JLabel();
        LogInButton = new javax.swing.JButton();
        RegisterLabel = new javax.swing.JLabel();
        RegisterButton = new javax.swing.JButton();
        RememberMeBox = new javax.swing.JCheckBox();

        setPreferredSize(new java.awt.Dimension(563, 315));

        UsernameInput.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));

        WelcomeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        WelcomeLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/plenprojects/swingclient/resources/logoplaceholder.png"))); // NOI18N

        PasswordLabel.setText("Password:");

        UsernameLabel.setText("Username:");

        LogInButton.setText("Log in");
        LogInButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LogInButtonActionPerformed(evt);
            }
        });

        RegisterLabel.setText("Don't have an account? Register now!");

        RegisterButton.setText("Register");
        RegisterButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RegisterButtonActionPerformed(evt);
            }
        });

        RememberMeBox.setText("Remember me.");
        RememberMeBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RememberMeBoxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(156, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(WelcomeLabel)
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(PasswordLabel)
                                .addComponent(UsernameLabel))
                            .addGap(31, 31, 31)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(UsernameInput)
                                .addComponent(PasswordInput)))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(LogInButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(RememberMeBox)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(RegisterLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(RegisterButton)))
                .addContainerGap(147, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(WelcomeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(40, 40, 40)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(UsernameInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(UsernameLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(PasswordInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(PasswordLabel, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LogInButton)
                    .addComponent(RememberMeBox))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(RegisterLabel)
                    .addComponent(RegisterButton))
                .addContainerGap(28, Short.MAX_VALUE))
        );
    }// </editor-fold>                        

    private void LogInButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
        
        //TODO
        
    }                                           

    private void RememberMeBoxActionPerformed(java.awt.event.ActionEvent evt) {                                              
        
        //TODO
        
    }                                             

    private void RegisterButtonActionPerformed(java.awt.event.ActionEvent evt) {                                               
        
        //TODO
        
    }                                              

    // Variables declaration - do not modify                     
    private javax.swing.JButton LogInButton;
    private javax.swing.JPasswordField PasswordInput;
    private javax.swing.JLabel PasswordLabel;
    private javax.swing.JButton RegisterButton;
    private javax.swing.JLabel RegisterLabel;
    private javax.swing.JCheckBox RememberMeBox;
    private javax.swing.JTextField UsernameInput;
    private javax.swing.JLabel UsernameLabel;
    private javax.swing.JLabel WelcomeLabel;
    // End of variables declaration                   
}
